package taskone;

import java.util.Scanner;



class QuadraticEquation {

    private double a;

    private double b;

    private double c;



    public QuadraticEquation(double a, double b, double c) {

        this.a = a;

        this.b = b;

        this.c = c;

    }



    public double getA() {

        return a;

    }



    public double getB() {

        return b;

    }



    public double getC() {

        return c;

    }



    public double getDiscriminant() {

        return b * b - 4 * a * c;

    }



    public double getRoot1() {

        if (getDiscriminant() >= 0) {

            return (-b + Math.sqrt(getDiscriminant())) / (2 * a);

        }

        return 0;

    }



    public double getRoot2() {

        if (getDiscriminant() >= 0) {

            return (-b - Math.sqrt(getDiscriminant())) / (2 * a);

        }

        return 0;

    }

}



public class taskone {

    public static void main(String[] args) {

        Scanner scanner = new Scanner(System.in);

        System.out.print("Enter a, b, c: ");

        double a = scanner.nextDouble();

        double b = scanner.nextDouble();

        double c = scanner.nextDouble();

        QuadraticEquation equation = new QuadraticEquation(a, b, c);

        double discriminant = equation.getDiscriminant();

        if (discriminant > 0) {

            System.out.println("The roots are " + equation.getRoot1() + " and " + equation.getRoot2());

        } else if (discriminant == 0) {

            System.out.println("The root is " + equation.getRoot1());

        } else {

            System.out.println("The equation has no roots.");

        }

    }

}
